package com.javatest.springboot2ratelimit.service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2020-07-21 下午4:42
 */
public interface RedisService {
    /**
     * 写入缓存
     *
     * @param key
     * @param value
     * @return
     */
    boolean set(final String key, Object value);

    /**
     * 写入缓存设置时效时间
     *
     * @param key
     * @param value
     * @param expireTime
     * @return
     */
    boolean setEx(final String key, Object value, Long expireTime);


    /**
     * 判断缓存中是否有对应的value
     *
     * @param key
     * @return
     */
    boolean exists(final String key);

    /**
     * 读取缓存
     *
     * @param key
     * @return
     */
    Object get(final String key);


    /**
     * 删除对应的value
     *
     * @param key
     * @return
     */
    boolean remove(final String key);
}
